package com.ming.from;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author:何元才
 * @Desc:
 * @data:2021-04-11 20:51
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysUserForm {

    /**
     * 用户ID
     */
    private Integer id;

    /**
     * 登录名
     */
    @Length(min = 6,max = 15,message = "登录名6-15字符串") //数据校验
    @NotBlank(message = "登录名不能为空")
    private String loginName;

    /**
     * 登录密码
     */
    @Length(min = 6,max = 32,message = "登录密码名6-32字符串") //数据校验
    private String loginPassword;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Length(min = 11,max = 11,message = "手机号只能为11位") //数据校验
    private String phone;

    /**
     * 真实姓名
     */
    @NotBlank(message = "真实姓名不能为空")
    @Length(min = 1,max = 20,message = "姓名是1到20的字符")
    private String realname;


    /**
     * 性别  1 男  2 女
     */
    @NotNull(message = "性别不能为空")
    @Range(min = 1,max = 2,message = "性别只能是男或女")
    private Integer sex;

    /**
     * 地址
     */
    @Length(max = 100,message = "地址最多只能100个字符")
    private String address;

    /**
     * 图像
     */
    private String img;

    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 1.有效
     * 2.无效
     */
    private Integer deleted;
}
